cmake_minimum_required (VERSION 3.8)

#project(httplib)

IF(CMAKE_BUILD_TYPE MATCHES "Debug" AND WIN32)
	add_definitions(-D__DEBUG__)
	add_definitions(-D__WIN32__)
	add_definitions(-D_LIB)
ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND WIN32)
	add_definitions(-D__WIN32__)
	add_definitions(-D_LIB)
ELSEIF(CMAKE_BUILD_TYPE MATCHES "Debug" AND UNIX)
	add_definitions(-D__DEBUG__)
	add_definitions(-D__LINUX__)
	add_definitions(-fpermissive)
ELSEIF((CMAKE_BUILD_TYPE MATCHES "Release" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") AND UNIX)
	add_definitions(-D__LINUX__)
	add_definitions(-fpermissive)
ENDIF()

file(GLOB httplib_srcs "*.cpp")
add_library(httplib_objs OBJECT ${httplib_srcs})
add_library(httplib STATIC $<TARGET_OBJECTS:httplib_objs>)
